home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / cdbw.zip / SERROR.C < prev    next >
Text File  |  1991-05-15  |  2KB  |  53 lines

  1. /*
  2.  *  SERROR.C
  3.  *
  4.  *  This module contains error handling routines for SAMPLE.EXE.
  5.  *
  6.  *  Copyright (C) 1991 by Daytris.  All rights reserved.
  7.  */
  8.  
  9. #include <windows.h>
  10. #include <stdio.h>
  11. #include "dbmgr.h"
  12.  
  13.  
  14. /************************************************
  15.  * Function Declarations
  16.  ************************************************/
  17.  
  18. void DbError( HWND hWnd, DWORD dwError, PSTR pFile, WORD wLineNbr);
  19.  
  20.  
  21. /***************************************************************************
  22.  * Function : DbError
  23.  *
  24.  * Purpose  : This function handles CDB database errors.
  25.  *
  26.  * Returns  : n/a
  27.  ***************************************************************************/
  28. void DbError( HWND hWnd, DWORD dwError, PSTR pFile, WORD wLineNbr)
  29.     {
  30.     char szBuffer[512];
  31.  
  32.     if( LOWORD( dwError) == E_TESTDRIVE)
  33.         {
  34.         sprintf( szBuffer, "Error Code:   E_TESTDRIVE\n\n\n"
  35.                            "This version of CDB For Windows is a\n"
  36.                            "test drive version.  The number of\n"
  37.                            "records added to a record type is\n"
  38.                            "limited to 50.\n\n\n"
  39.                            "See the document CDBW.WRI to obtain\n"
  40.                            "a registered version of CDB For Windows\n");
  41.         }
  42.     else
  43.         {
  44.         sprintf( szBuffer, "Error Code:        %d\n"
  45.                            "Extended Code:     %d\n\n"
  46.                            "Source File Name:  %s\n"
  47.                            "Line Number:       %u\n\n"
  48.                            "Contact Technical Support\n",
  49.             LOWORD( dwError), HIWORD( dwError), pFile, wLineNbr);
  50.         }
  51.     MessageBox( hWnd, szBuffer, "Database Error", MB_ICONEXCLAMATION | MB_OK);
  52.     }
  53.